home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / locale.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-18  |  2.6 KB  |  139 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  2. #if __SC__ || __RCC__
  3. #pragma once
  4. #endif
  5.  
  6. #ifndef __LOCALE_H
  7. #define __LOCALE_H 1
  8.  
  9. #if __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. #ifndef __STDC__
  14. #if !defined(_WCHAR_T_DEFINED)
  15. typedef unsigned short wchar_t;
  16. #define _WCHAR_T_DEFINED 1
  17. #endif
  18. #endif
  19.  
  20. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  21. #ifndef _CRTAPI1
  22. #define _CRTAPI1 __cdecl
  23. #endif
  24.  
  25. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  26. #ifndef _CRTAPI2
  27. #define _CRTAPI2 __cdecl
  28. #endif
  29.  
  30. /* Define CRTIMP */
  31. #ifndef _CRTIMP
  32. #if defined(_WIN32) && defined(_DLL)
  33. #define _CRTIMP  __declspec(dllimport)
  34. #else
  35. #define _CRTIMP
  36. #endif
  37. #endif
  38.  
  39. #if __OS2__ && __INTSIZE == 4
  40. #define __CLIB    __stdcall
  41. #else
  42. #define __CLIB    __cdecl
  43. #endif
  44.  
  45. #ifndef __NT__
  46. enum _LOCALE
  47. {   _LOCALE_C,
  48.     _LOCALE_USA,
  49.     _LOCALE_ITALY,
  50.     _LOCALE_NETHERLANDS,
  51.     _LOCALE_NORWAY,
  52.     _LOCALE_SWITZERLAND,
  53.     _LOCALE_UK,
  54.     _LOCALE_JAPAN,
  55.     _LOCALE_KOREA,
  56.     _LOCALE_CHINA,
  57.     _LOCALE_TAIWAN,
  58.     _LOCALE_MAX
  59. };
  60. #define _LOCALE_NATIVE    _LOCALE_USA
  61. #endif
  62.  
  63. #pragma pack(1)
  64. struct lconv
  65. {
  66.     char *decimal_point;
  67.     char *thousands_sep;
  68.     char *grouping;
  69.     char *int_curr_symbol;
  70.     char *currency_symbol;
  71.     char *mon_decimal_point;
  72.     char *mon_thousands_sep;
  73.     char *mon_grouping;
  74.     char *positive_sign;
  75.     char *negative_sign;
  76.     char int_frac_digits;
  77.     char frac_digits;
  78.     char p_cs_precedes;
  79.     char p_sep_by_space;
  80.     char n_cs_precedes;
  81.     char n_sep_by_space;
  82.     char p_sign_posn;
  83.     char n_sign_posn;
  84. #ifndef __NT__
  85.     char lc[6];
  86. #endif
  87.     char int_p_cs_precedes;
  88.     char int_n_cs_precedes;
  89.     char int_p_sep_by_space;
  90.     char int_n_sep_by_space;
  91.     char int_p_sign_posn;
  92.     char int_n_sign_posn;
  93. };
  94.  
  95. #pragma pack()
  96.  
  97. #define LC_ALL        0
  98. #define LC_COLLATE    1
  99. #define LC_CTYPE    2
  100. #define LC_MONETARY    3
  101. #define LC_NUMERIC    4
  102. #define LC_TIME        5
  103.  
  104. #define LC_MIN          LC_ALL
  105. #define LC_MAX          LC_TIME
  106.  
  107. #ifndef NULL
  108. #ifdef __cplusplus
  109. #define NULL 0
  110. #else
  111. #define NULL ((void *)0)
  112. #endif
  113. #endif
  114.  
  115. char * __CLIB setlocale(int category, const char *locale);
  116. struct lconv * __CLIB localeconv(void);
  117.  
  118. #ifdef _WIN32
  119. #ifndef __STDC__
  120. wchar_t * __CLIB _wsetlocale(int, const wchar_t *);
  121. #endif
  122. #endif
  123.  
  124. #if _CHAR_UNSIGNED
  125. /*
  126.    The standard states localeconv should return valuse of CHAR_MAX,
  127.    well with -J, CHAR_MAX is 255 and not 127. To deal with this, we
  128.    need this extern to cause RTL startup code to fix up the lconv
  129.    structure returned from localeconv
  130. */
  131. int __charmax;
  132. #endif
  133.  
  134. #if __cplusplus
  135. }
  136. #endif
  137.  
  138. #endif
  139.